project(simple-csim)
cmake_minimum_required(VERSION 2.8)

SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${simple-csim_SOURCE_DIR})

IF(WIN32)
    SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
ELSE(WIN32)
    SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
ENDIF(WIN32)

FIND_PACKAGE(LibCSim REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED QUIET)

include(FindCellmlLibraries)

# Set compiler flags
if (WIN32)
else(WIN32)
    add_definitions("-std=c++11" "-Wall" "-Werror")
    set(PLATFORM_LIBS ${PLATFORM_LIBS} "m")
endif(WIN32)

# Global includes?
INCLUDE_DIRECTORIES(
  ${LIBCSIM_INCLUDE_DIRS}
  ${LIBXML2_INCLUDE_DIR}
)

SET(SRCS
  main.cpp
)

set(EXECUTABLE_NAME "simple-csim")
ADD_EXECUTABLE(${EXECUTABLE_NAME} ${SRCS})
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME}
  ${LIBCSIM_LIBRARIES}
  ${CELLML_LIBRARIES}
  ${LIBXML2_LIBRARIES}
  ${PLATFORM_LIBS}
)

set(EXECUTABLE_GIB_NAME "simple-csim-gib")
ADD_EXECUTABLE(${EXECUTABLE_GIB_NAME} main_gib.cpp)
TARGET_LINK_LIBRARIES(${EXECUTABLE_GIB_NAME}
  ${LIBCSIM_LIBRARIES}
  ${CELLML_LIBRARIES}
  ${LIBXML2_LIBRARIES}
  ${PLATFORM_LIBS}
)
